using Assets.Scripts.SO;
using Assets.Scripts.UI;
using PrimeTween;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace Assets.Scripts.Controllers
{
    internal class UIController : BaseController<UIController>
    {
        [SerializeField] private HappyPopup _childInformationPopup;

        public void ShowChildInformation(ScriptableChild child)
        {
            Tween.StopAll(_childInformationPopup);

            _childInformationPopup.gameObject.SetActive(true);
            _childInformationPopup.Set(child);
            Tween.Scale(_childInformationPopup.transform, Vector3.zero, Vector3.one * .8f, .1f, Ease.OutBack);
        }

        public void HideChildInformation()
        {
            
            Tween.Scale(_childInformationPopup.transform, Vector3.zero, .1f, Ease.Linear).OnComplete(() =>
            {
                _childInformationPopup.gameObject.SetActive(false);
            });
        }
    }
}
